<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class LikeController extends Controller
{
    //我喜欢
    public function getIndex()
    {
        $res = DB::table("project_goods")->where("status",2)->get();


        return view("/home/like",['res'=>$res]);
        
    }

    //取消
    public function getQu(Request $request)
    {
        $id = $request->input("id");

        $arr['status'] = 1;

        $res = DB::table("project_goods")->where("id",$id)->update($arr);

        if($res) {
            echo "yes";
        } else {
            echo "no";
        }
    }
}
